package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.ShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@Api(tags = "店铺营业状态接口")
@RestController(value = "adminShopController")//给bean起名字防止名字冲突
@RequestMapping("/admin/shop")
public class ShopController {
    @Autowired
    private ShopService shopService;

    @ApiOperation("获取营业状态")
    @GetMapping("/status")
    public Result getStatus() {
        return shopService.status();
    }

    @ApiOperation("设置营业状态")
    @PutMapping("/{status}")
    public Result upadteStatus(@PathVariable Integer status) {
        return shopService.upadteStatus(status);
    }
}
